const express = require('express')
const router = express.Router()

// 登录
const login = require('./serverApi/login.js')

// 更新用户数据
const updateUser = require('./serverApi/updateUser.js')

// 发送邮箱验证码
const sendEmail = require('./serverApi/sendemail.js')

// 验证邮箱验证码
const register = require('./serverApi/register.js')

// 更新用户密码
const updatePwd = require('./serverApi/updatePwd')

// 上传日记
const addDiary = require('./serverApi/addDiary')

// base64 上传日记图片
const upArticleImg = require('./serverApi/uploaderImg.js')

// 获取用户日记
const getUserDiary = require('./serverApi/getUserDiary')

// 删除用户日记
const deleteDiary = require('./serverApi/deleteDiary')

// 更新用户日记
const updateDiary = require('./serverApi/updateDiary')

// 获取 回收站 的日记
const getRecycleDiary = require('./serverApi/getRecycleDiary')

// 删除 回收站 的某个日记
const delRecycleDiary = require('./serverApi/delRecycleDiary')

// 恢复 回收站 的日记
const postRecycleDiary = require('./serverApi/postRecycleDiary')

// 删除 回收站 所有日记
const delRecycleAllDiary = require('./serverApi/delRecycleAllDiary')

router.post('/login', login.post)
router.put('/updateUser', updateUser.put)
router.post('/sendEmail', sendEmail.post)
router.post('/register', register.post)
router.post('/updatePwd', updatePwd.post)
router.post('/addDiary', addDiary.post)
router.post('/upArticleImg', upArticleImg.post)
router.get('/getUserDiary', getUserDiary.get)
router.delete('/delUserDiary', deleteDiary.delete)
router.post('/updateDiary', updateDiary.post)
router.get('/getRecycleDiary', getRecycleDiary.get)
router.delete('/delRecycleDiary', delRecycleDiary.delete)
router.post('/postRecycleDiary', postRecycleDiary.post)
router.delete('/delRecycleAllDiary', delRecycleAllDiary.delete)

module.exports = router
